#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>
#include <assert.h>

size_t my_strlen1(char* start)
{
	size_t count = 0;

	assert(start != NULL);

	while (*start != '\0')
	{
		count++;
		start++;
	}

	return count;
}

size_t my_strlen2(char* start)
{
	assert(start != NULL);

	if (*start == '\0')
	{
		return 0;
	}

	return 1 + my_strlen2(start + 1);
}

size_t my_strlen3(char* start)
{
	char* begin = start;
	char* rear = start;
	assert(start != NULL);
	while (*rear != '\0')
	{
		rear++;
	}

	return rear - begin;
}

int main()
{
	char str1[20] = { "zhao" };
	size_t str_len1 = 0;
	str_len1 = my_strlen1(str1);
	printf("%d\n", str_len1);

	size_t str_len2 = 0;
	str_len2 = my_strlen2(str1);
	printf("%d\n", str_len2);

	size_t str_len3 = 0;
	str_len3 = my_strlen3(str1);
	printf("%d\n", str_len3);

	return 0;
}